﻿using System.Collections.Generic;

namespace MvcWebScraper.Core.Parsers
{
    public class WillcomCIDRParser : MobileCIDRScraper<List<string>>
    {
        protected override List<string> Parser(HtmlAgilityPack.HtmlDocument document)
        {
            var cidr = new List<string>();

            foreach (var td in document.DocumentNode.SelectNodes("/html/body/table[3]/tr/td[3]/table[7]/tr/td/table[1]/tr/td[2]/table/tr[position()>1]/td"))
            {
                var font = td.SelectSingleNode("font");
				if(font==null)
					break;

                var val = font.InnerText;
                cidr.Add(val);
            }

            return cidr;
        }
    }
}
